package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PurHospitalMapper;
import com.ruoyi.system.domain.PurHospital;
import com.ruoyi.system.service.IPurHospitalService;

/**
 * hospitalService业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-09
 */
@Service
public class PurHospitalServiceImpl implements IPurHospitalService 
{
    @Autowired
    private PurHospitalMapper purHospitalMapper;

    /**
     * 查询hospital
     * 
     * @param id hospital主键
     * @return hospital
     */
    @Override
    public PurHospital selectPurHospitalById(Integer id)
    {
        return purHospitalMapper.selectPurHospitalById(id);
    }

    /**
     * 查询hospital列表
     * 
     * @param purHospital hospital
     * @return hospital
     */
    @Override
    public List<PurHospital> selectPurHospitalList(PurHospital purHospital)
    {
        return purHospitalMapper.selectPurHospitalList(purHospital);
    }

    /**
     * 新增hospital
     * 
     * @param purHospital hospital
     * @return 结果
     */
    @Override
    public int insertPurHospital(PurHospital purHospital)
    {
        purHospital.setCreateTime(DateUtils.getNowDate());
        return purHospitalMapper.insertPurHospital(purHospital);
    }

    /**
     * 修改hospital
     * 
     * @param purHospital hospital
     * @return 结果
     */
    @Override
    public int updatePurHospital(PurHospital purHospital)
    {
        purHospital.setUpdateTime(DateUtils.getNowDate());
        return purHospitalMapper.updatePurHospital(purHospital);
    }

    /**
     * 批量删除hospital
     * 
     * @param ids 需要删除的hospital主键
     * @return 结果
     */
    @Override
    public int deletePurHospitalByIds(Integer[] ids)
    {
        return purHospitalMapper.deletePurHospitalByIds(ids);
    }

    /**
     * 删除hospital信息
     * 
     * @param id hospital主键
     * @return 结果
     */
    @Override
    public int deletePurHospitalById(Integer id)
    {
        return purHospitalMapper.deletePurHospitalById(id);
    }
}
